import time

from selenium import webdriver
from selenium.webdriver.common.by import By

driver=webdriver.Edge()
driver.maximize_window()
driver.get('file:///C:/Users/lenovo/Downloads/alert.html')
# 点击弹窗
driver.find_element(By.ID,'button').click()
time.sleep(3)
# alert=driver.switch_to.alert
alert=driver.switch_to.alert
time.sleep(3)
alert.accept()
time.sleep(5)


